package com.naiterui.ehp.bs.b2c.order.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <pre>
 *   订单明细
 * </pre>
 *
 * @author zhouyanxin
 * @date 2019/1/11 下午11:19
 * @since 1.0.0
 */
@Data
@Entity
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "e_order_item")
public class OrderItem implements java.io.Serializable {
    private static final long serialVersionUID = -4342388008627912645L;
    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;
    /**
     * 订单ID
     */
    @Column(name = "order_id", nullable = false)
    private Long orderId;
    /**
     * 商品ID
     */
    @Column(name = "product_id", nullable = false)
    private Long productId;
    /**
     * 商品名称
     */
    @Column(name = "product_name", nullable = false, length = 40)
    private String productName;
    /**
     * sku id
     */
    @Column(name = "sku_id", nullable = false)
    private Long skuId;
    /**
     * sku 名称
     */
    @Column(name = "sku_name", nullable = false, length = 40)
    private String skuName;
    /**
     * 商品图
     */
    @Column(name = "icon", nullable = false)
    private String icon;
    /**
     * 数量
     */
    @Column(name = "quantity", nullable = false)
    private Integer quantity;
    /**
     * 售价
     */
    @Column(name = "sale_price", nullable = false)
    private Integer salePrice;
    /**
     * 处方药标识 1：处方药；2：OTC
     */
    private Integer rx;

    @Column(name = "doctor_id", nullable = false)
    private Long doctorId;

    @Column(name = "recom_id", nullable = false)
    private Long recomId;

    /**
     * 创建时间
     */
    @Column(name = "created_at")
    private Date createdAt;

    /**
     * 创建人
     */
    @Column(name = "created_by")
    private String createdBy;

    /**
     * 修改时间
     */
    @Column(name = "changed_at")
    private Date changedAt;

    /**
     * 修改人
     */
    @Column(name = "changed_by")
    private String changedBy;

    /**
     * 乐观锁
     */
    @Version
    private Integer version;

}
